﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WindowsFormsApp1.IICMoudle
{
    class ChipSt : IChip
    {

        private const int FLASH_ERASE_TIMEOUT_MS = 200;
        private const int FLASH_POLL_RESOLUTION_MS = 50;
        private const int DRAM_WRITE_CHUNK = 32;
        private const int FLASH_PROGRAM_TIMEOUT_MS = 3000;
        private const int DRAM_SIZE = 64 * 1024;

        public IICDataListener Listener { get; set; }

        public void ClearDataReady()
        {
            throw new NotImplementedException();
        }

        public int[] GetData(int len)
        {
            throw new NotImplementedException();
        }

        public int ReadAdcToUvCoef()
        {
            throw new NotImplementedException();
        }

        public byte[] ReadAfeGain()
        {
            throw new NotImplementedException();
        }

        public float[] ReadCoeff(int chNum)
        {
            throw new NotImplementedException();
        }

        public short ReadDacToMvCoef()
        {
            throw new NotImplementedException();
        }

        public int ReadDataReady()
        {
            throw new NotImplementedException();
        }

        public string ReadFwVersion()
        {
            throw new NotImplementedException();
        }

        public short ReadModuleConnect()
        {
            throw new NotImplementedException();
        }

        public string ReadModuleConnectDynamic()
        {
            throw new NotImplementedException();
        }

        public short[] ReadOffset(int chNum)
        {
            throw new NotImplementedException();
        }

        public byte[] ReadReg(byte[] readData, int readLen)
        {
            byte[] wBuf = new byte[256];
            byte[] rBuf = new byte[256];
            uint wLen;
            uint rLen;
            wBuf[0] = I2CConstant.REG_IIC_ADDRESS;
            for (int i = 1; i <= readData.Length; i++)
            {
                wBuf[i] = readData[i - 1];
            }
            wLen = (uint)(readData.Length + 1);
            rLen = (uint)readLen;
            IIC.WriteRead(wLen, wBuf, rLen, rBuf);
            byte[] result = new byte[readLen];
            Array.Copy(rBuf, 0, result, 0, readLen);
            return result;
        }

        public void SetDebugMode(byte mode)
        {
            throw new NotImplementedException();
        }

        public UpgradeResult UpdateFW(string filePath)
        {
            throw new NotImplementedException();
        }

        public byte WriteCoeff(float[] coefficient)
        {
            throw new NotImplementedException();
        }

        public bool WriteReg(byte[] writeData, int writeLen)
        {
            throw new NotImplementedException();
        }
    }
}
